1 <?php
2 include(
"db.php");
3 session_start();

4 if
(isSet($_POST['username']) && isSet($_POST['password']))
5 {

6 // username and password sent
from Form
7 $username=mysqli_real_escape_string($db,$_POST[
'username']);
8 $password=(mysqli_real_escape_string($db,$_POST[
'password']));
9 $passadd = ( md5(md5(md5( md5(md5(md5( addslashes($password))))))));
10
11 $result=mysqli_query($db,
"SELECT * FROM thanhvien WHERE user='$username' and pass='$passadd'");
12 $count=mysqli_num_rows($result);
13
14 $row=mysqli_fetch_array($result,MYSQLI_ASSOC);

15 // If result matched $myusername and $mypassword, table row must be
1 row
16 if
($count==1)
17 {
18 $_SESSION[
'mem']=$row['user'];
19 echo $row[
'user'];
20 }
21
22 }
23 ?>



Full source code website bán hàng thương mại điện tử gần giống shopee 468.807 lượt xem

Gõ tìm kiếm nhanh...